#include <stdio.h>
#include <string.h>

struct book
{
	char title[10];
	char author[20];
	char press[20];		
    double price;
    int amount;
};

int main(void)
{
	struct book s;
	struct book *p;

	strcpy(s.title, "dream");
	strcpy(s.author, "LiYing");
    strcpy(s.press , "WuhanPress");
    s.price = 10.5;
	s.amount = 2;

	puts("s.title\t\ts.author\t\ts.press\t\ts.price\t\ts.amount");
	printf("%s\t\t%s\t\t%s\t\t%.1f\t\t%d\n\n", s.title, s.author, s.press, s.price, s.amount);
	p = &s;
	puts("(*p).title\t(*p).author\t(*p).press\t(*p).price\t(*p).amount");
	printf("%s\t\t%s\t\t%s\t\t%.1f\t\t%d\n", (*p).title, (*p).author, (*p).press, (*p).price, (*p).amount);
	puts("p->title\t\tp->author\t\tp->press\t\tp->price\t\tp->amount");
	printf("%s\t\t%s\t\t%s\t\t%.1f\t\t%d\n", p->title,p->author,p->press,p->price,p->amount);

	return 0;
}